package com.bindatax.core.statistics;


import lombok.Getter;

@Getter
public class StatisticsData {

    private final static ThreadLocal<StatisticsData> STATISTICS_DATA_THREAD_LOCAL = new ThreadLocal<StatisticsData>(){
        @Override
        protected StatisticsData initialValue() {
            StatisticsData statisticsData = new StatisticsData();
            statisticsData.previousTaskStatistics = new ExecuteStatistics();
            statisticsData.taskStatistics = new ExecuteStatistics();
            return statisticsData;
        }
    };
    private ExecuteStatistics previousTaskStatistics;//上一次的统计值
    private ExecuteStatistics taskStatistics;//实时统计值

    public static StatisticsData getLocal(){
        return STATISTICS_DATA_THREAD_LOCAL.get();
    }

}
